package test;

import dao.NoteDao;
import dao.impl.NoteDaoImpl;
import pojo.Label;
import pojo.Note;
import pojo.NoteLabels;
import service.NoteLabelsService;
import service.impl.NoteLabelsServiceImpl;

import java.sql.SQLException;
import java.util.ArrayList;

public class tests {
    public static void main(String[] args) throws SQLException, ClassNotFoundException {
//        NoteLabelsService noteLabelsService=new NoteLabelsServiceImpl();
//        ArrayList<NoteLabels> noteAllLabelsList=new ArrayList<>();
//        noteAllLabelsList=noteLabelsService.noteLabelsList(48);
//        ArrayList<Label> noteLabels=new ArrayList<>();
//        noteLabels=noteLabelsService.noteLabels(noteAllLabelsList);
//        System.out.println(noteLabels);
        NoteDao noteDao=new NoteDaoImpl();
        ArrayList<Note> list=new ArrayList<>();
        NoteLabelsService noteLabelsService=new NoteLabelsServiceImpl();
        ArrayList<NoteLabels> searchNoteLabels=new ArrayList<>();
        searchNoteLabels=noteLabelsService.exatSearchAllLabels("日常生活");
        System.out.println(searchNoteLabels);
        for (NoteLabels searchNoteLabel : searchNoteLabels) {
            Note note=new Note();
            note=noteDao.findNote(searchNoteLabel.getNid());
            System.out.println(note);
            if(note.getContent()!=null)list.add(note);

        }
        System.out.println("here");
        System.out.println(list);
    }
}
